Skip to content

feat: Add a network profiling TUI.#2969

Open
iphydf wants to merge 1 commit into
TokTok:masterfrom
iphydf:netprof-ui
Open

feat: Add a network profiling TUI.#2969
iphydf wants to merge 1 commit into
TokTok:masterfrom
iphydf:netprof-ui

Conversation

@iphydf
Copy link
Copy Markdown
Member

@iphydf iphydf commented Jan 12, 2026

This change is Reviewable

@iphydf iphydf added this to the v0.2.22 milestone Jan 12, 2026
@github-actions github-actions Bot added the enhancement New feature for the user, not a new feature for build script label Jan 12, 2026
@iphydf iphydf force-pushed the netprof-ui branch 11 times, most recently from 37b7767 to 49a278b Compare January 12, 2026 23:00
@Green-Sky
Copy link
Copy Markdown
Member

==================
WARNING: ThreadSanitizer: data race (pid=1108689)
  Write of size 8 at 0x7fff9ef8e238 by main thread:
    #0 tox::netprof::safe_stod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double&) /home/green/workspace/tox/c-toxcore/testing/netprof/model_utils.cc:57 (netprof+0x44642d)
    #1 tox::netprof::NetProfApp::handle_command(tox::netprof::UICommand) /home/green/workspace/tox/c-toxcore/testing/netprof/app.cc:74 (netprof+0x43fdb1)
    #2 operator() /home/green/workspace/tox/c-toxcore/testing/netprof/app.cc:13 (netprof+0x4410dd)
    #3 __invoke_impl<void, tox::netprof::NetProfApp::NetProfApp(bool)::<lambda(tox::netprof::UICommand)>&, tox::netprof::UICommand> /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/invoke.h:61 (netprof+0x4410dd)
    #4 __invoke_r<void, tox::netprof::NetProfApp::NetProfApp(bool)::<lambda(tox::netprof::UICommand)>&, tox::netprof::UICommand> /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/invoke.h:111 (netprof+0x4410dd)
    #5 _M_invoke /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/std_function.h:290 (netprof+0x4410dd)
    #6 std::function<void (tox::netprof::UICommand)>::operator()(tox::netprof::UICommand) const /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/std_function.h:591 (netprof+0x48ee07)
    #7 tox::netprof::NetProfUI::handle_event(ftxui::Event) /home/green/workspace/tox/c-toxcore/testing/netprof/ui.cc:263 (netprof+0x48d08f)
    #8 operator() /home/green/workspace/tox/c-toxcore/testing/netprof/ui.cc:163 (netprof+0x48d996)
    #9 __invoke_impl<bool, tox::netprof::NetProfUI::NetProfUI(CommandCallback)::<lambda(ftxui::Event)>&, ftxui::Event> /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/invoke.h:61 (netprof+0x48d996)
    #10 __invoke_r<bool, tox::netprof::NetProfUI::NetProfUI(CommandCallback)::<lambda(ftxui::Event)>&, ftxui::Event> /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/invoke.h:114 (netprof+0x48d996)
    #11 _M_invoke /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/std_function.h:290 (netprof+0x48d996)
    #12 std::_Function_handler<bool (ftxui::Event), ftxui::CatchEvent(std::function<bool (ftxui::Event)>)::{lambda(std::shared_ptr<ftxui::ComponentBase>)#1}::operator()(std::shared_ptr<ftxui::ComponentBase>) const::{lambda(ftxui::Event)#1}>::_M_invoke(std::_Any_data const&, ftxui::Event&&) <null> (netprof+0x4e2bcb)
    #13 tox::netprof::NetProfApp::run(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/green/workspace/tox/c-toxcore/testing/netprof/app.cc:50 (netprof+0x439b92)
    #14 main /home/green/workspace/tox/c-toxcore/testing/netprof/main.cc:26 (netprof+0x423689)

  Previous read of size 8 at 0x7fff9ef8e238 by thread T3:
    #0 tox::netprof::NetProfApp::simulation_loop() /home/green/workspace/tox/c-toxcore/testing/netprof/app.cc:432 (netprof+0x43f75e)
    #1 operator() /home/green/workspace/tox/c-toxcore/testing/netprof/app.cc:47 (netprof+0x43fa4f)
    #2 __invoke_impl<void, tox::netprof::NetProfApp::run(bool, const std::string&)::<lambda()> > /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/invoke.h:61 (netprof+0x43fa4f)
    #3 __invoke<tox::netprof::NetProfApp::run(bool, const std::string&)::<lambda()> > /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/invoke.h:96 (netprof+0x43fa4f)
    #4 _M_invoke<0> /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/std_thread.h:301 (netprof+0x43fa4f)
    #5 operator() /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/std_thread.h:308 (netprof+0x43fa4f)
    #6 _M_run /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/std_thread.h:253 (netprof+0x43fa4f)
    #7 execute_native_thread_routine <null> (libstdc++.so.6+0xed063)

  Location is stack of main thread.

  Location is global '<null>' at 0x000000000000 ([stack]+0x1e238)

  Thread T3 (tid=1108693, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.2+0x5f4a6)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xed138)
    #2 main /home/green/workspace/tox/c-toxcore/testing/netprof/main.cc:26 (netprof+0x423689)

SUMMARY: ThreadSanitizer: data race /home/green/workspace/tox/c-toxcore/testing/netprof/model_utils.cc:57 in tox::netprof::safe_stod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double&)
==================

@iphydf iphydf force-pushed the netprof-ui branch 11 times, most recently from da546fc to 972699e Compare January 13, 2026 01:52
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 54.09836% with 140 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.41%. Comparing base (8a8d027) to head (972699e).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
testing/support/doubles/network_universe.cc 50.00% 64 Missing ⚠️
toxcore/tox_private.c 0.00% 20 Missing ⚠️
testing/support/doubles/fake_sockets_test.cc 0.00% 17 Missing ⚠️
testing/support/doubles/fake_sockets.cc 61.53% 15 Missing ⚠️
testing/support/doubles/fake_network_stack_test.cc 0.00% 7 Missing ⚠️
testing/support/doubles/fake_network_stack.cc 0.00% 5 Missing ⚠️
testing/support/src/fake_clock.cc 66.66% 4 Missing ⚠️
toxcore/tox_api.c 0.00% 4 Missing ⚠️
toxcore/events/dht_nodes_response.c 81.81% 2 Missing ⚠️
testing/support/public/simulation.hh 50.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2969      +/-   ##
==========================================
- Coverage   70.69%   70.41%   -0.28%     
==========================================
  Files         181      181              
  Lines       32780    32910     +130     
==========================================
+ Hits        23174    23175       +1     
- Misses       9606     9735     +129     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@iphydf iphydf force-pushed the netprof-ui branch 2 times, most recently from 4dbf48e to cffbc27 Compare January 13, 2026 02:52
@iphydf iphydf marked this pull request as ready for review January 13, 2026 10:38
Comment thread testing/netprof/CMakeLists.txt
@iphydf iphydf force-pushed the netprof-ui branch 2 times, most recently from fb3c5d8 to c04fc5c Compare January 14, 2026 15:38
@iphydf iphydf modified the milestones: v0.2.22, v0.2.23 Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature for the user, not a new feature for build script

Development

Successfully merging this pull request may close these issues.

2 participants